function coherency_phase_spa(wave_phase,wave_coher,period,time_out,coi_out,lat,time,ilat,itps)

close all
figure;
set(gcf,'Visible','off')          

Yticks = 2.^(0:fix(log(max(period))/log(2)));
load map_phase
colormap(map_phase)



% --------------------------------
subplot(2,2,1)
pcolor(time_out,period,wave_phase')
shading flat
set(gca,'YScale','log',...
    'YDir','reverse',...
    'YTick',Yticks,...
    'Yticklabel',Yticks,...
    'Tickdir','out');
fig=colorbar('vert');
ylabel('Wavelength (km)')
title('Phases');
hold on
plot(time_out,coi_out,'k')   % cone-of-influence, anything "below" is dubious
hold off            
xlabel('Longitude');

subplot(2,2,2)
pcolor(time_out,period,wave_coher')
shading flat
set(gca,'YScale','log',...
    'YDir','reverse',...
    'YTick',Yticks,...
    'Yticklabel',Yticks,...
    'Tickdir','out');
fig=colorbar('vert');
%ylabel('Longueurs d''onde (km)')
title('Coherency');
hold on
plot(time_out,coi_out,'k')   % cone-of-influence, anything "below" is dubious
hold off
xlabel('Distance');




print('-f1','-depsc2',['./COHER_spa_',num2str(lat(ilat)),'_',num2str(time(itps)),'.eps'])
close all
            